<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isErrorPage="true" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>错误页面 - IT招聘网</title>
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/error.css">
</head>
<body>
    <jsp:include page="top.jsp"></jsp:include>

    <div class="success_content">
        <div class="success_left">
            <div class="error"></div>
        </div>
        <div class="success_right">
            <h3>抱歉，系统发生错误</h3>
            <p class="green16">
                <%
                    // 获取异常信息
                    String errorMsg = "未知错误";
                    if(exception != null) {
                        errorMsg = exception.getMessage();
                        if(errorMsg == null || errorMsg.trim().equals("")) {
                            errorMsg = exception.toString();
                        }
                    } else if(request.getAttribute("javax.servlet.error.exception") != null) {
                        Throwable ex = (Throwable)request.getAttribute("javax.servlet.error.exception");
                        errorMsg = ex.getMessage();
                        if(errorMsg == null || errorMsg.trim().equals("")) {
                            errorMsg = ex.toString();
                        }
                    } else if(request.getAttribute("javax.servlet.error.status_code") != null) {
                        String statusCode = request.getAttribute("javax.servlet.error.status_code").toString();
                        if("404".equals(statusCode)) {
                            errorMsg = "请求的资源不存在";
                        } else if("500".equals(statusCode)) {
                            errorMsg = "服务器内部错误";
                        } else {
                            errorMsg = "HTTP错误 " + statusCode;
                        }
                    }
                %>
                <%= errorMsg %>
            </p>
            <p>
                <a href="index.jsp" class="tn-button">返回首页</a>
                <span onclick="history.back();" class="tn-button">返回上一页</span>
            </p>
        </div>
        <div style="clear:both;"></div>
    </div>

    <jsp:include page="foot.html"></jsp:include>
</body>
</html>